﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ObviousCode.Aspect.PluginLibrary.Interfaces;
using System.Drawing;
using ObviousCode.Aspect.PluginLibrary;
using ObviousCode.Common.Utils.Library.Dictionaries;

namespace ObviousCode.UI.Aspect.PluginLibrary.Interfaces
{
    public interface ISurfaceObjectFactory
    {
        void Setup();
        void TearDown();

        IEnumerable<string> AvailableItemKeys { get; }

        SurfaceItemDescriptor this[string key] { get; }

        bool ContainsKey(string key);

        void RegisterSurfaceItemDescriptor(string key, SurfaceItemDescriptor descriptor);

        void RegisterDescription(string key, string description);
        void RegisterItemBuilderCallback(string key, IAspectItemFactory factory);
        void RegisterUITheme(string key, IUITheme theme);        
        void RegisterImages(string key, ChartObjectImages images);

        ISurfaceObject BuildObject(string key);
        ISurfaceObject BuildObject(Type itemType);


        PropertyDictionary Properties { get; }

        bool ContainsAspectItemFactory(Type type);

        SurfaceItemDescriptor GetDescriptorContainingAspectItemFactoryFor(Type type);
        Type InstanceType { get; }        
    }

    public interface ISurfaceObjectFactory<T> : ISurfaceObjectFactory where T : ISurfaceObject { }
}
